# -*- coding: utf-8 -*-
#
#    Copyright (C) 2012 Gonzalo Bonigo <gonzalobonigo@gmail.com>
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see http://www.gnu.org/licenses/
#


"""En este modulo se define la clase Alphabet"""


class Alphabet(set):
    """Esta clase representa el alfabeto de un LTS.
    Un alfabeto es un conjunto de eventos."""

    def get_event_set_by_type(self, event_type):
        """Devuelve el conjunto de eventos del mismo tipo indicado por
        'event_type'.
        Arguemtnos:
            event_type - Tipo de evento [event.Event.Type].
        Retorno: Un conjunto de eventos de tipo 'event_type'.
        """
        return set([event for event in self if event.TYPE == event_type])
